﻿Public Partial Class admin_permiso
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnInsertar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnInsertar.Click
        Try
            Dim cl As New ASI_2UFG_BL.class_admin
            cl.Insertar_Permiso("I", dropPagina.SelectedValue, DropRol.SelectedValue, 0)
            If cl.log = 0 Then
                Me.lbMensaje.Text = "Eliminado Con Exito"
                GridPermiso.DataBind()
            Else
                Me.lbMensaje.Text = "Error al Eliminar el Registro"
            End If
        Catch ex As Exception
            MsgBox(ex, MsgBoxStyle.Critical)
        End Try
    End Sub

    Protected Sub btonEliminar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btonEliminar.Click
        Try
            Dim cl As New ASI_2UFG_BL.class_admin
            cl.Eliminar_Permiso("I", txtID.Text, 0)
            If cl.log = 0 Then
                Me.lbMensaje.Text = "Ingresado Con Exito"
                GridPermiso.DataBind()
            Else
                Me.lbMensaje.Text = "Error al ingresar el Registro"
            End If
        Catch ex As Exception
            MsgBox(ex, MsgBoxStyle.Critical)
        End Try
    End Sub

    Protected Sub btonModificar_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btonModificar.Click
        Try
            Dim cl As New ASI_2UFG_BL.class_admin
            cl.Modificar_Permiso("M", txtID.Text, dropPagina.SelectedValue, DropRol.SelectedValue, 0)
            If cl.log = 0 Then
                Me.lbMensaje.Text = "Modificado Con Exito"
                GridPermiso.DataBind()
            Else
                Me.lbMensaje.Text = "Error al Modificar el Registro"
            End If
        Catch ex As Exception
            MsgBox(ex, MsgBoxStyle.Critical)
        End Try
    End Sub
End Class